import {designPage} from "@peryl/react-compose";
import {useTableOption} from "../../modules/plain-design/useTableOption";
import {AutoTable, PlcCheckbox, PlcDate, PlcInput} from "plain-design";

export default designPage(() => {

  const option = useTableOption({
    url: '/cms_page',
    fill: true,
  });

  return () => <>
    <AutoTable option={option}>
      <PlcInput title="页面标题" field="title" required/>
      <PlcInput title="页面编码" field="code" required/>
      <PlcInput title="页面地址" field="path" width={200} required overflowTooltip/>
      <PlcCheckbox title="可新建" field="creatable"/>
      <PlcCheckbox title="可编辑" field="updatable"/>
      <PlcCheckbox title="可删除" field="deletable"/>
      <PlcCheckbox title="可导入" field="importable"/>
      <PlcCheckbox title="可导出" field="exportable"/>

      <PlcDate title="创建时间" field="createdAt" hideInForm width={180} editable={false} datetime/>
    </AutoTable>
  </>;
});
